<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .box {
      width: 500px;
      height: 100px;
      background-color: orange;
    }

    .item {
      height: 50px;
      display: inline-block;
    }

    .item1 {
      /* width的百分比相对于包含块(父元素) */
      width: calc(100% - 100px);
      background-color: #f00;
    }

    .item2 {
      width: 100px;
      background-color: #0f0;
    }
  </style>
</head>
<body>
  
  <div class="box">
    <div class="item item1"></div>
    <div class="item item2"></div>
  </div>

</body>
</html>